From: Jasper St. Pierre Date: Thu, 23 Jun 2011 01:29:20 +0000 (-0400) Subject: extension-tool: Use socket.gethostname() instead of an external process X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8057 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c8d5e0a51c2a7416425ea7ab07c55ae8aad525fc;p=gnome-shell.git extension-tool: Use socket.gethostname() instead of an external process Minor code cleanup. https://bugzilla.gnome.org/show_bug.cgi?id=653206 --- diff --git a/src/gnome-shell-extension-tool.in b/src/gnome-shell-extension-tool.in index 578fe2de4..0dcbf9bea 100644 --- a/src/gnome-shell-extension-tool.in +++ b/src/gnome-shell-extension-tool.in @@ -3,6 +3,7 @@ import os import re +import socket import subprocess import sys import optparse @@ -41,7 +42,7 @@ Examples are: "Make windows visible on click", "Block advertisement popups" underifier = re.compile('[^A-Za-z]') sample_uuid = underifier.sub('_', name) # TODO use evolution data server - hostname = subprocess.Popen(['hostname'], stdout=subprocess.PIPE).communicate()[0].strip() + hostname = socket.gethostname() sample_uuid = sample_uuid + '@' + hostname print